using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;


namespace MyFrame.Mono
{

    public class MonoController : MonoBehaviour
    {
        private event UnityAction updateEvent;

        private void Start() {
            DontDestroyOnLoad(this);
        }

        private void Update() {
            if (updateEvent != null) {
                updateEvent();
            }
        }

        public void AddUpdateEvent(UnityAction action) {
            updateEvent += action;
        }

        public void RemoveUpdateEvent(UnityAction action) {
            updateEvent -= action;
        }
    }
}
